<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改货区设置')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-areaInfo-edit" th:object="${areaInfo}">
            <input id="areaId" name="areaId" th:field="*{areaId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">货区编码：</label>
				<div class="col-sm-8">
					<input id="areaCode" name="areaCode" th:field="*{areaCode}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">货区名：</label>
				<div class="col-sm-8">
					<input id="areaName" name="areaName" th:field="*{areaName}" class="form-control" type="text">
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label">仓库：</label>
				<div class="col-sm-8">
					<select id="wareId" name="wareId" class="form-control" >
						<option v-for="ware in wares" v-bind:value="ware.wareId">{{ware.wareName}}</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="memo" name="memo" th:field="*{memo}" class="form-control" type="text">
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/areaInfo";
		$("#form-areaInfo-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-areaInfo-edit').serialize());
	        }
	    };

		var app = new Vue({
			el: '.wrapper',
			data: {

				wares:[],
			},
			methods:{
				getWares:function(){
					var that = this;
					$.ajax({
						cache : true,
						type : "POST",
						url :  "/system/wareInfo/list",
						data : {
						},
						async : false,
						error : function(request) {
							$.modal.alertError("系统错误");
						},
						success : function(data) {
							that.wares = data.rows;
						}
					});

				}
			},
			created:function(){
				this.getWares();


			},

		})
	</script>
</body>
</html>
